var accordion=function(){
	var tm=sp=10;
	function slider(n){this.nm=n; this.arr=[]}
	slider.prototype.init=function(t,c,k){
		var a,h,s,l,i; a=document.getElementById(t); this.sl=k?k:'';
		h=a.getElementsByTagName('dt'); s=a.getElementsByTagName('dd'); this.l=h.length;
		for(i=0;i<this.l;i++){var d=h[i]; this.arr[i]=d; d.onclick=new Function(this.nm+'.pro(this)');}
		l=s.length;
		for(i=0;i<l;i++){var d=s[i]; d.mh=d.offsetHeight; d.style.height=0; d.style.display='none'}
	}
	slider.prototype.pro=function(d){
		//alert();
		 var id = $(d).find("input").val();
		 //alert(id);
		//alert(d.getElementByName('msgid'));
		 var szurl="http://jcpt.chengdu.gov.cn/uycyw/front/sysmessage/updateStatus.htm?id="+id;
	     jQuery.ajax({
	     url: szurl,
	     type: "get",
		 async: false,
	     dataType: "json",
	     jsonp: "callbackparam",
		 jsonpCallback:"success_jsonpCallback",
	     timeout : 10000,
	     success: function(data) {
			 if(data == 1){
				 $(d).find("td[name='status']").text("已读");
			 }
	     },
	     error: function(XMLHttpRequest, textStatus, errorThrown) {
	    	 //alert(textStatus+"---:::"+errorThrown);
	     },
	     complete: function(XMLHttpRequest, textStatus) {
	         this; // 调用本次AJAX请求时传递的options参数
	     }
	     });
		
		
		for(var i=0;i<this.l;i++){
			var h=this.arr[i], s=h.nextSibling; s=s.nodeType!=1?s.nextSibling:s; clearInterval(s.tm);
			if((h==d&&s.style.display=='none') || (h==d&&s.style.display=='')){s.style.display=''; su(s,1); h.className=this.sl}
			else if(s.style.display==''){su(s,-1); h.className=''}
		}
	}
	function su(c,f){c.tm=setInterval(function(){sl(c,f)},tm)}
	function sl(c,f){
		var h=c.offsetHeight, m=c.mh, d=f==1?m-h:h; c.style.height=h+(Math.ceil(d/sp)*f)+'px';
		c.style.opacity=h/m; c.style.filter='alpha(opacity='+h*100/m+')';
		if(f==1&&h>=m){clearInterval(c.tm)}else if(f!=1&&h==1){c.style.display='none'; clearInterval(c.tm)}
	}
	return{slider:slider}
}();